package com.cty.B_SpecialDataStructures.B_Queue.QueueChain;

import com.cty.B_SpecialDataStructures.B_Queue.QueueArray.QueueArray;
import com.cty.F_common.DataItem;

/**
 * @Auther: cty
 * @Date: 2020/6/14 8:54
 * @Description: 测试 链表实现队列
 * @version: 1.0
 */
class QueueChainApp {
    public static void main(String[] args) {
        QueueChain queue = new QueueChain();
        DataItem findItem;

        System.out.println("测试 insert()");
        queue.insert(new DataItem(11));
        queue.insert(new DataItem(22));
        queue.insert(new DataItem(33));
        queue.insert(new DataItem(44));
        queue.insert(new DataItem(55));
        queue.insert(new DataItem(66));
        queue.insert(new DataItem(77));
        queue.insert(new DataItem(88));
        queue.insert(new DataItem(99));
        queue.insert(new DataItem(0));
        queue.displayQueue();
        System.out.println("---------------------------------------------------------");

        System.out.println("测试 peek()");
        findItem = queue.peek();
        System.out.println("Peeked " + findItem.getKey());
        System.out.println("---------------------------------------------------------");

        System.out.println("测试 remove()");
        queue.remove();
        queue.remove();
        queue.remove();
        queue.remove();
        queue.insert(new DataItem(15));
        queue.insert(new DataItem(16));
        queue.displayQueue();
        System.out.println("---------------------------------------------------------");

    }  // end main()
}  // end QueueArrayApp{}

/**
 * 测试 insert()
 * 11 22 33 44 55 66 77 88 99 0
 * ---------------------------------------------------------
 * 测试 peek()
 * Peeked 11
 * ---------------------------------------------------------
 * 测试 remove()
 * 55 66 77 88 99 0 15 16
 * ---------------------------------------------------------
 */
